﻿using System;
using Package;

namespace ATMCableCloud
{
    namespace CableCloudExceptions
    {
        class NodeNotFound : Exception
        {
	        readonly Graph.NetworkGraph.Node e_;
			
            public NodeNotFound(Graph.NetworkGraph.Node endpoint)
            {
                e_ = endpoint;
            }
            public override string ToString()
            {
                return "Not found node \"" + e_.name + "\"\n";
            }
        }
		class NodeNameNotFound : Exception
		{
			readonly string name_;

			public NodeNameNotFound(string name)
			{
				name_ = name;
			}
			public override string ToString()
			{
				return "Not found node with name \"" + name_ + "\"\n";
			}
		}
        class MultipleUsingEndpoint : Exception
        {
	        readonly int port_;
	        readonly Graph.NetworkGraph.Node e_;
            public MultipleUsingEndpoint(Graph.NetworkGraph.Node endpoint, int p)
            {
                e_ = endpoint;
                port_ = p;
            }
            public override string ToString()
            {
                return "Used more than once: \"" + e_.name + "\"" + "port number= " + port_ + "\n";
            }
        }
        class RecipientNotFound : Exception
        {
	        readonly CellPackage package_;
            public RecipientNotFound(CellPackage package)
            {
                package_ = package;
            }
            public override string ToString()
            {
                return "Not found Recipient for cell on port:"+ package_.linkPort +"\n";
            }
        }
		class ClientDisconnectedException : Exception
		{
		}
    }
}
